<?php

namespace app\mall\ui\table;

use app\mall\enum\InvoiceStatusEnum;
use suframe\thinkAdmin\ui\table\TableInterface;

/**
 * 发票管理表格
 */
class MallInvoiceTable extends TableInterface
{
    public function header()
    {
        return [
            'id'=> ['label' => 'ID', 'sort' => true, 'fixed' => 'left', 'width' => 70],
            'create_time'=> ['label' => '申请时间', 'width' => 160],
            'user_nickname'=> ['label' => '会员', 'width' => 100],
            'money'=> ['label' => '开票金额', 'width' => 100],
            'linkman'=> ['label' => '联系人姓名', 'width' => 100],
            'phone'=> ['label' => '联系人电话', 'width' => 120],
            'title'=> ['label' => '发票抬头'],
            'status_text'=> ['label' => '状态', 'filter' => InvoiceStatusEnum::toZhArray(), 'width' => 80, 'field' => 'status'],
            'courier_time'=> ['label' => '快递时间', 'width' => 160],
        ];
    }

    public function filters()
    {
        return [
            'phone' => ['label' => '手机号', 'type' => 'text'],
            'create_time' => ['label' => '申请时间', 'type' => 'daterange'],
        ];
    }
}